let moment =require('moment')
function Wx_msg_tpl() {
    this.type = {
        release:{

        },
        job:{

        }
    }
}

Wx_msg_tpl.prototype = {

    _task_create_success:function (touser="",first="",name="",status="",remark="") {
        let d = {
           /* content: "{{first.DATA}} 兼职名称：{{keyword1.DATA}} 审核结果：{{keyword2.DATA}} {{remark.DATA}}",
            example: "您提交的兼职信息已经审核完毕 兼职名称：奥林匹克公园游客引导 审核结果：通过 点击查看兼职页面"*/
            "touser":touser,
            "template_id": "-_pou-ArL2NNFgIEBoBByOYg1ITw_5_Hay1hE8csoqE",
            "url": "",
            "data": {
                "first": {
                    "value": first,
                    "color": "#173177"
                },
                "keyword1": {
                    "value": name,
                    "color": "#173177"
                },
                "keyword2": {
                    "value":status,
                    "color": "#173177"
                },
                "remark":{
                    "value":moment(new Date()).format('YYYY-MM-Do').toString(),
                    "color": "#173177"
                }
            }
        };
        return d;

    },

    /**
     * 发布任务成功提醒
     * @param touser
     * @param task_title
     * @param task_id
     * @returns {{touser: *, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: *, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_create_success:function (touser,task_title,task_id) {
        let d = {
            "touser":touser,
            "template_id": "NcPRoAESGVfgwxTcHOhND4vQbyPw7kfLFbEmgpbkkMA",
            "url": `http://m.zxskill.com/task_detail?task_id=${task_id}`,
            "data": {
                "first": {
                    "value": '您的需求已发布成功',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": task_title,
                    "color": "#173177"
                },
                "keyword2": {
                    "value":'需求已发布，等待服务商响应',
                    "color": "#173177"
                },
                "remark":{
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                }
            }
        }
       return d;

    },
    /**
     * 报名成功提醒
     * @param touser
     * @returns {{touser: *, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, keyword3: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    sign_success:function (touser) {
        let d = {
            "touser":touser,
            "template_id": "O4kBfV5nru1wUcvg-1ku3ojULOZUx3P5Z7hQ8rx5MTI",
            "url": `http://m.zxskill.com/job`,
            "data": {
                "first": {
                    "value": '报名成功通知',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": '任务报名',
                    "color": "#173177"
                },
                "keyword2": {
                    "value":'报名成功',
                    "color": "#173177"
                },
                "keyword3": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "remark":{
                    "value":'点击查看详情',
                    "color": "#173177"
                }
            }
        };
        return d;
    },
    /**
     * 任务报名提醒
     * @param touser
     * @param nickname
     * @returns {{touser: *, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: *, color: string}, keyword2: {value: string, color: string}, keyword3: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    sign_notice:function (touser,nickname) {
        let d = {
            "touser":touser,
            "template_id": "5N01GRzOwuOXnlHF0CD1ZIDYipgbkYx8MfG1VFAtsPs",
            "url": `http://m.zxskill.com/release`,
            "data": {
                "first": {
                    "value": '你好，有人报名你在知行平台发布的任务啦！',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": nickname,
                    "color": "#173177"
                },
                "keyword2": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "keyword3": {
                    "value":'未知',
                    "color": "#173177"
                },
                "remark":{
                    "value":'点击查看详情',
                    "color": "#173177"
                }
            }
        };
        return d;
    },
    /**
     * 任务授权
     * @param touser
     * @returns {{touser: *, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    sign_get:function (touser) {
        let d = {
            "touser":touser,
            "template_id": "A2VtOetZBmsRnTCvFxSmi0qwecFZ_WAgxQqGTTYros8",
            "url": `http://m.zxskill.com/job/job_doing`,
            "data": {
                "first": {
                    "value": '你好，您在知行平台报名的任务已中标啦！,请及时跟进处理',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": '雇主已同意将任务给你',
                    "color": "#173177"
                },
                "keyword2": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "remark":{
                    "value":'点击查看详情',
                    "color": "#173177"
                }
            }
        };
        return d;
    },
    /**
     * 任务点击完成,乙方
     * @param touser
     * @returns {{touser: *, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_finish_one:function (touser) {
        let d = {
            "touser":touser,
            "template_id": "A2VtOetZBmsRnTCvFxSmi0qwecFZ_WAgxQqGTTYros8",
            "url": `http://m.zxskill.com/release/doing`,
            "data": {
                "first": {
                    "value": '你好，您在知行平台发布的任务有新进展了,乙方已确认完成,请登录平台处理哦',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": '乙方已完成,待甲方确认',
                    "color": "#173177"
                },
                "keyword2": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "remark":{
                    "value":'点击查看详情',
                    "color": "#173177"
                }
            }
        };
        return d;
    },

    user_w_message:function (touser,nickname,amount) {
        let d = {
            "touser":touser,
            "template_id": "zuPTCQwDrDJ_GcdhHCgNNgwKGLZw5vDKwppUaWquuwU",
            // "url": `http://m.zxskill.com/release/doing`,
            "data": {
                "first": {
                    "value": '你好，有用户申请提款啦,请及时处理哦',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": nickname,
                    "color": "#173177"
                },
                "keyword2": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "keyword3": {
                    "value":amount,
                    "color": "#173177"
                },
                "keyword4": {
                    "value":'微信',
                    "color": "#173177"
                },
                "remark":{
                    "value":'点击查看详情',
                    "color": "#173177"
                }

            }
        };
        return d;
    },
    /**
     * 点击完成,甲方
     * @param touser
     * @returns {{touser: *, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_finish_two:function (touser) {
        let d = {
            "touser":touser,
            "template_id": "A2VtOetZBmsRnTCvFxSmi0qwecFZ_WAgxQqGTTYros8",
            "url": `http://m.zxskill.com/job/job_end`,
            "data": {
                "first": {
                    "value": '你好，您在知行平台接的任务有新进展了,甲方已确认完成,请登录平台处理哦',
                    "color": "#173177"
                },
                "keyword1": {
                    "value": '甲方已同意完成,项目完结',
                    "color": "#173177"
                },
                "keyword2": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "remark":{
                    "value":'点击查看详情',
                    "color": "#173177"
                }
            }
        };
        return d;
    },

    sign_fail:function (touser,id) {
        let d = {
            "touser":touser,
            "template_id": "qAyff1KE1IQ1UGd2i38-CEr5M70u6gkoD5eFPuH_U8k",
            "url": `http://m.zxskill.com/`,
            "data": {
                "first": {
                    "value": `很遗憾，您在知行报名任务${id}为的任务，已被别人抢去啦，但别灰心，再接再厉吧！`,
                    "color": "#173177"
                },
                "keyword1": {
                    "value": '任务类型',
                    "color": "#173177"
                },
                "keyword2": {
                    "value": '失败',
                    "color": "#173177"
                },
                "keyword3": {
                    "value":moment(new Date()).format('YYYY-MM-DD HH:mm'),
                    "color": "#173177"
                },
                "remark":{
                    "value":'登录平台查看更多任务',
                    "color": "#173177"
                }
            }
        };
        return d;
    },

}
var wx_msg_tpl = new Wx_msg_tpl();

module.exports = wx_msg_tpl;

var list = {
    template_list: [
        {
            "template_id": "zLOkHkzdlo_pJQQpS5SXWlosrPcruuBNwFEoySBm6lk",
            "title": "订阅模板消息",
            "primary_industry": "",
            "deputy_industry": "",
            "content": "{{content.DATA}}",
            "example": ""
        },
        {
            "template_id": "mqfq90O9OuLaj_ceoT3mIo500uzKvbHUDjJBkAp9OLo",
            "title": "拒绝录用通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n兼职名称：{{keyword1.DATA}}\n拒绝原因：{{keyword2.DATA}}\n{{remark.DATA}}",
            "example": "抱歉，您报名的兼职未被录取\r\n兼职名称：资料录入员\r\n拒绝原因：岗位人数已满\r\n温馨提示：登陆APP查看更多兼职，e职多给你最优质的服务。"
        },
        {
            "template_id": "NcPRoAESGVfgwxTcHOhND4vQbyPw7kfLFbEmgpbkkMA",
            "title": "需求发布成功通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n需求名称：{{keyword1.DATA}}\n需求状态：{{keyword2.DATA}}\n{{remark.DATA}}",
            "example": "您的需求已发布成功，相应的服务提供商会收到您的需求并参与竞标。\r\n需求名称：成都某广告位二维码扫码应用开发需求\r\n需求状态：需求已发布，等待服务商响应\r\n点击查看详情"
        },
        {
            "template_id": "Hh5f1JR53t1UvV8kyhpjnODq2LgTWdXXLM9IYiBga0w",
            "title": "客户新需求推送通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n客户需求：{{keyword1.DATA}}\n客户名称：{{keyword2.DATA}}\n提出时间：{{keyword3.DATA}}\n{{remark.DATA}}",
            "example": "xx网成功为您匹配到了新的客户需求，赶紧点击详情查看吧。\r\n客户需求：客户提出了一份宠物护理的需求。\r\n客户名称：张三\r\n提出时间：2015-08-18 23:45\r\n请及时登录平台处理，超过24小时未报价将视为放弃该需求。 感谢您对xx网的支持，祝您生活愉快！"
        },
        {
            "template_id": "O4kBfV5nru1wUcvg-1ku3ojULOZUx3P5Z7hQ8rx5MTI",
            "title": "报名成功通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n报名类型：{{keyword1.DATA}}\n报名结果：{{keyword2.DATA}}\n发送时间：{{keyword3.DATA}}\n{{remark.DATA}}",
            "example": "青少年象棋大赛报名通知\r\n报名类型：象棋比赛\r\n报名结果：报名成功\r\n发送时间：2016年4月12号\r\n感谢你的参与"
        },
        {
            "template_id": "5N01GRzOwuOXnlHF0CD1ZIDYipgbkYx8MfG1VFAtsPs",
            "title": "用户报名提醒",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n报名人：{{keyword1.DATA}}\n报名时间：{{keyword2.DATA}}\n报名总数：{{keyword3.DATA}}\n{{remark.DATA}}",
            "example": "你好，有人报名你发起的活动啦！\r\n报名人：奔跑的兄弟\r\n报名时间：2016-10-25 23:15\r\n报名总数：6\r\n感谢使用，查看活动详情&gt;&gt;"
        },
        {
            "template_id": "vs25GgpW5oEimh9qsvv_ZWb_QU_TxvreKw5HUnw1tCA",
            "title": "项目进度通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n项目详情：{{keyword1.DATA}}\n发送时间：{{keyword2.DATA}}\n{{remark.DATA}}",
            "example": "2016年5月31日项目情况\r\n项目详情：www.baidu.com\r\n发送时间：2016年5月31号\r\n详情请点到链接。"
        },
        {
            "template_id": "A2VtOetZBmsRnTCvFxSmi0qwecFZ_WAgxQqGTTYros8",
            "title": "申请进度通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n当前进度：{{keyword1.DATA}}\n更新时间：{{keyword2.DATA}}\n{{remark.DATA}}",
            "example": "XXX扫描了您的海报，再努力召唤一下，就可领取免费测试！\r\n当前进度：剩余2位，你就可以领取1个免费测试；\r\n更新时间：2017-11-24  15：03\r\n加油！58.8元测试等你领到手哦！"
        },
        {
            "template_id": "8r0tnmnrIRyP1IGqzR8vl93soeuqg3EkamxNSfV-mYY",
            "title": "待办项目更新通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n待办项目：{{keyword1.DATA}}\n待办环节：{{keyword2.DATA}}\n更新时间：{{keyword3.DATA}}\n{{remark.DATA}}",
            "example": "您好！您的在办移民项目有最新进度，请及时跟进办理：\r\n待办项目：188A-澳洲创业移民\r\n待办环节：上传EOI申请和州担保相关资料\r\n更新时间：2015年8月11日 09:36\r\n点击“详情”可跟进办理，如有疑问请直接在微信留言，小编将会第一时间联系您！"
        },
        {
            "template_id": "2PyvpSimLg50pRrE2OK9yA2KKU_lMDP_S0iAkyh2e8Q",
            "title": "兼职审核结果通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n兼职名称：{{keyword1.DATA}}\n审核结果：{{keyword2.DATA}}\n{{remark.DATA}}",
            "example": "您提交的兼职信息已经审核完毕\r\n兼职名称：奥林匹克公园游客引导\r\n审核结果：通过\r\n点击查看兼职页面"
        },
        {
            "template_id": "v02QtEn-IZE_SCz5P6Jy4beK_SqxvrUvrahDL0_VWfc",
            "title": "竞价结果通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n竞价商品：{{keyword1.DATA}}\n中标价格：{{keyword2.DATA}}\n您的出价：{{keyword3.DATA}}\n{{remark.DATA}}",
            "example": "您好，您竞拍的商品竞价结果已揭晓。\r\n竞价商品：iphone6s\r\n中标价格：3668元\r\n您的出价：1280元\r\n很遗憾，您未能竞拍成功。"
        },
        {
            "template_id": "xSRBOivYTLhN35Hlv9hkPP6PCjcVogDA86SuqZRkCu0",
            "title": "提现结果通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n提现商户：{{keyword1.DATA}}\n提现金额：{{keyword2.DATA}}\n提现账户：{{keyword3.DATA}}\n处理时间：{{keyword4.DATA}}\n{{remark.DATA}}",
            "example": "提现结果通知\r\n提现商户：街觅\r\n提现金额：￥2015.69\r\n提现账户：支付宝：xxx@xx.xx\r\n处理时间：2015年06月09日11:24:45\r\n您好，您的提现已经处理，处理结果是：成功<失败>"
        },
        {
            "template_id": "zuPTCQwDrDJ_GcdhHCgNNgwKGLZw5vDKwppUaWquuwU",
            "title": "提现申请通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n昵称：{{keyword1.DATA}}\n时间：{{keyword2.DATA}}\n金额：{{keyword3.DATA}}\n方式：{{keyword4.DATA}}\n{{remark.DATA}}",
            "example": "你好,提现申请已经收到\r\n昵称：张三\r\n时间：2016年5月13日\r\n金额：10.00元\r\n提现方式：微信\r\n感谢你的使用。"
        },
        {
            "template_id": "q7M79nBRn4Drjl6fMlfcv2ID52vbAvAvKZ6fqEVZXFY",
            "title": "提现申请成功通知",
            "primary_industry": "IT科技",
            "deputy_industry": "互联网|电子商务",
            "content": "{{first.DATA}}\n提现金额：{{keyword1.DATA}}\n处理时间：{{keyword2.DATA}}\n提现方式：{{keyword3.DATA}}\n{{remark.DATA}}",
            "example": "恭喜，您的提现已转银行处理，具体到账时间以银行为准，请注意查收~~\r\n提现金额：￥1000.00\r\n处理时间：2016-08-27 20:20:58\r\n提现方式：中国农业银行(33**333)\r\n感谢您的使用！如有疑问请联系客服"
        }
    ]
}
